<?php

class FormRadioButton extends FormControl {
	
	public static $property = array(
		'wbtype',
		'name',
		'caption',
		'x',
		'y',
		'width',
		'height',
		'disabled',
		'checked',
		'group',
		'visible'
	);	
	
	public function __construct() { 
		parent::__construct(array(
			'wbtype' => 'RadioButton',
			'x' => 0,
			'y' => 0,
			'width' => 100,
			'height' => 18,
			'caption' => 'this is radio button'
		));
	}

	/**
	 * 컨트롤 그리기 
	 * 
	 * @param WBGraphics $graphics
	 */
	public function displayControl(WBGraphics $g) {

		$xstart = $this->getOption('x');
		$ystart = $this->getOption('y');
		$width = $this->getOption('width');
		$height = $this->getOption('height');		
		$caption = $this->getOption('caption');		
	
		$xend = $xstart + $width;
		$yend = $ystart + $height;

		if (ProjectManager::$checkWireFrame->isChecked()) { 
			$g->ellipse($xstart + 1, $ystart + 1, 11, 11, FormControl::SHADE, false, 1, WBGraphics::LINE_DASHES_2);
		} else { 
			
			$image = ($this['checked']) ? self::$draw_radio_checked : self::$draw_radio;
			
			$g->image($image, $xstart, $ystart);
		}
		
		$font = ($this['disabled']) ? self::$disabledFont : self::$realFont ;
		
		$g->text($caption, $xstart + 16, $ystart, $width - 16, $height, $font, WBC_LEFT | WBC_TOP);		

	}
	
	public function getProperty() { 
		return self::$property;
	}	
}


?>